package com.genericdevice.platform.core.event.listeners;

import com.genericdevice.platform.core.event.IEvent;

/**
 * Created by Xilent on 18.05.2014.
 */
public abstract class PluginChangeListener implements IEventListener {
    private boolean isOnce;

    protected PluginChangeListener(boolean isOnce) {
        this.isOnce = isOnce;
    }

    @Override
    public boolean isOnce() {
        return isOnce;
    }

    @Override
    public void onSuccess(IEvent event) {
        onChange(event);
    }

    @Override
    public void onFailure(Throwable reason) {}

    protected abstract void onChange(IEvent event);
}
